package com.bsj.pay.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bsj.pay.dao.MessageDao;
import com.bsj.pay.model.MessageBean;
import com.bsj.pay.service.MessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class MessageServiceImpl implements MessageService
{
  @Autowired
  private MessageDao dao;
  
  public long insert(MessageBean t)
  {
    return this.dao.insert(t);
  }
  
  public int deleteById(Long id)
  {
    return this.dao.deleteById(id);
  }
  
  public List<MessageBean> queryList(MessageBean t)
  {
    return this.dao.queryList(t);
  }
  
  public int update(MessageBean t)
  {
    return this.dao.update(t);
  }
  
  public MessageBean getById(Long Id)
  {
    return (MessageBean)this.dao.getById(Id);
  }
  
  public long count(MessageBean t)
  {
    return this.dao.count(t);
  }
  
  public PageInfo<MessageBean> pageList(MessageBean t, int pageNum, int pageSize)
  {
    PageHelper.startPage(pageNum, pageSize);
    List<MessageBean> list = this.dao.queryList(t);
    PageInfo<MessageBean> pageInfo = new PageInfo<MessageBean>(list);
    return pageInfo;
  }
  
  public int removeById(Long id)
  {
    return this.dao.removeById(id);
  }
  
  public List<MessageBean> queryAll()
  {
    return this.dao.queryAll();
  }

	@Override
	public int removeByTime(long startTime, long endTime) {
		// TODO Auto-generated method stub
		return dao.removeByTime(startTime, endTime);
	}
}
